package com.cao.service.impl;

import com.cao.mapper.UserMapper;
import com.cao.pojo.SysUser;
import com.cao.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.misc.BASE64Decoder;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public SysUser login(String name, String password) {
        SysUser select = userMapper.select(name);
        if (select==null){
            return null;
        }

        if (password.equals(select.getPassword())){
            return select;
        }
        return null;

    }
}
